<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="common/header" />
<body>
<!--导航-->
<div class="login">
    <div class="message">登录</div>
    <div id="darkbannerwrap"></div>
	<input name="action" value="login" type="hidden">
	<input id="loginName" name="loginName" placeholder="邮箱" required="" type="text">
	<hr class="hr15">
	<input id="password" name="password" placeholder="密码" required="" type="password">
	<hr class="hr15">
	<input value="登录" id="login" style="width:100%;" type="submit">
	<hr class="hr20">
	没有帐号? <a href="/register">3秒注册</a>&nbsp;&nbsp;&nbsp;&nbsp;帮助 <a href="/resetPassword">忘记密码</a>
</div>
</body>
<link th:href="@{/resources/css/login.css}" type="text/css" rel="stylesheet">
<script>
	$(function () {
		$('#login').click(function () {
		    var user = {
		        "loginName": $('#loginName').val(),
		        "password": $('#password').val()
			};
            loading("请稍等，正在登录中!");
			$.getJSON('/loginAction', user, function (data) {
			    closeLoading();
			    if(data.code == 1) {
			        window.location = "/index";
				} else {
                    winTip('登录失败！请检查用户名和密码！', false);
                }
            });
        });
    });
</script>
</html>